package cn.yuyiling.jelly.srai.controller;

import cn.yuyiling.jelly.srai.api.RecommendationAdviceService;
import cn.yuyiling.jelly.srai.mongodb.entity.RecommendationAdvice;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/learning-advice")
public class RecommendationAdviceController {

    @DubboReference(scope = "remote")
    private RecommendationAdviceService recommendationAdviceService;

    @GetMapping("/{userId}")
    public String getLearningAdvice(@PathVariable String userId) {
        return recommendationAdviceService.generateRecommendationForUser(userId);
    }
}
